ConstructionProjectForm = Ext.extend(Ext.Window,
{
    constructor : function(a) {
        Ext.applyIf(this, a);
        this.initUIComponents();
        ConstructionProjectForm.superclass.constructor.call(this, {
            layout : "fit",
            id : this.inputFormName,
            items : yearGridFormPanel,
            modal : true,
            bodyStyle : "padding:2px;",
            buttonAlign : "center",
            buttons : yearGridFormButtons,
            title : "项目信息",
            iconCls : "menu-flowWait",
            width : 620,
            height : 375
        });
    },
    //初始化数据
    initUIComponents : function() {
        createyeargridform({
            operation:this,
            form:{
                saveUrl: __ctxPath+"/constructionproject/saveConstructionProject.do",
                items:[
                        {
                            id : "constructionProject.id",
                            name : "constructionProject.id",
                            xtype : "hidden",
                            value : this.id == null ? "": this.id
                        }, {
                            name : "constructionProject.years",
                            xtype : "hidden",
                            id : "constructionProject.years",
                            value : this.years == null ? "" : this.years
                        },{
                           layout:"column",
                           bodyStyle:"padding:5px;",
                           items:[{
                               layout:"form",
                               bodyStyle:"padding:5px;",
                               border:false,
                               columnWidth:.5,
                                   items:[{
                                       xtype:"textfield",
                                       fieldLabel:'项目名称' + '<font color=red>*</font>',
                                       name:'constructionProject.projectName',
                                       maxLength:80,
                                       allowBlank:false,
                                       width:146
                                   }]
                               },{
                                   layout:"form",
                                   bodyStyle:"padding:5px;",
                                   border:false,
                                   columnWidth:.5,
                                   items:[{
                                       xtype:"textfield",
                                       fieldLabel:'施工方',
                                       name:'constructionProject.contractor',
                                       maxLength:80,
                                       width:146
                                   }]
                               },{
                                   layout:"form",
                                   bodyStyle:"padding:5px;",
                                   border:false,
                                   columnWidth:.5,
                                   items:[{
                                       xtype:"textfield",
                                       fieldLabel:'安全负责人',
                                       name:'constructionProject.safetyManager',
                                       maxLength:80,
                                       width:146
                                   }]
                               },{
                                   layout:"form",
                                   bodyStyle:"padding:5px;",
                                   border:false,
                                   columnWidth:.5,
                                   items:[{
                                       //下拉选型设置
                                           fieldLabel : "所属机构",
                                           hiddenName : "constructionProject.institution",
                                           xtype : "combo",
                                           mode : "local",
                                           editable : false,
                                           width:146,
                                           triggerAction : "all",
                                           store:new Ext.data.ArrayStore({
                                               id:0,
                                               fields:['id','type'],
                                               data:[ [ "1", "组织部" ],
                                                      [ "2", "财务部" ],
                                                      [ "3", "销售部" ]]
                                           }),
                                           valueField:'type',
                                           displayField:'type',
                                           value:"销售部" 
                                   }]
                               },{
                                   layout:'form',
                                   bodyStyle:"padding:5px;",
                                   border:false,
                                   columnWidth:.5,
                                   items:[{
                                          xtype:'datefield',
                                          fieldLabel:'项目开始时间',
                                          id:'constructionProject.startDate',
                                          name:'constructionProject.startDate',
                                          format:'y-m-d',
                                          width:146
                                   }]
                               },{
                                   layout:'form',
                                   bodyStyle:'padding:5px;',
                                   border:false,
                                   columnWidth:.5,
                                   items:[{
                                       xtype:'datefield',
                                       fieldLabel:'项目结束时间',
                                       id:'constructionProject.endDate',
                                       name:'constructionProject.endDate',
                                       format:'y-m-d',
                                       width:146
                                   }]
                               }
                            ]
                       },{
                           layout:'column',
                           bodyStyle:"padding:5px;",
                           border:false,
                           items:[{
                               layout:"form",
                               bodyStyle:"padding:5px;",
                               columnWidth:1.,
                               items:[{
                               xtype:"numberfield", 
                               fieldLabel: '合同金额', 
                               name: 'constructionProject.contractAmount', 
                               width : 448 
                               }]
                           }]
                       },{
                           layout:'column',
                           bodyStyle:"padding:5px;",
                           border:false,
                           items:[{
                               layout:"form",
                               bodyStyle:"padding:5px;",
                               columnWidth:1.,
                               items:[{
                               xtype:"textarea", 
                               fieldLabel: '项目基本情况', 
                               name: 'constructionProject.basicSituation', 
                               width : 448 
                               }]
                           }]
                       },{
                           layout:'column',
                           bodyStyle:"padding:5px;",
                           border:false,
                           items:[{
                               layout:"form",
                               bodyStyle:"padding:5px;",
                               columnWidth:1.,
                               items:[{
                               xtype:"textarea", 
                               fieldLabel: '总结报告', 
                               name: 'constructionProject.summary', 
                               width : 448 
                               }]
                           }]
                       },{
                           layout:'column',
                           bodyStyle:"padding:5px;",
                           border:false,
                           items:[{
                               layout:'form',
                               bodyStyle:"padding:5px;",
                               columnWidth:1.,
                               items:[{
                               xtype:'textarea',
                               fieldLabel:'备注',
                               name:'constructionProject.remark',
                               width:448
                               }]
                           }]
                       },{
                           layout:'column',
                           bodyStyle:"padding:5px;",
                           border:false,
                           items:[{
                               layout:'form',
                               xtype:'fieldset',
                               title:'启动',  
                               collapsible:true,
                               //默认收起为true，默认为false
                               collapsed : true,
                               bodyStyle:"padding:5px;",
                               columnWidth:1.,
                               items:[{
                               xtype:'datefield',
                               fieldLabel:'启动时间',
                               name:'constructionProject.startTime',
                               width:146
                               },{
                                   xtype:'textarea',
                                   fieldLabel:'安全记录',
                                   name:'constructionProject.startRecord',
                                   width:448
                                },{
                                	 xtype:'textarea',
                                     fieldLabel:'管理措施',
                                     name:'constructionProject.startMeasure',
                                     width:448
                                },{
                               	 xtype:'textarea',
                                 fieldLabel:'启动备注',
                                 name:'constructionProject.startRemark',
                                 width:448
                            }]
                           }]
                       },{
                           layout:'column',
                           bodyStyle:"padding:5px;",
                           border:false,
                           items:[{
                               layout:'form',
                               xtype:'fieldset',
                               title:'实施',  
                               collapsible:true,
                               //默认收起为true，默认为false
                               collapsed : true,
                               bodyStyle:"padding:5px;",
                               columnWidth:1.,
                               items:[{
                                   xtype:'textarea',
                                   fieldLabel:'安全记录',
                                   name:'constructionProject.implementRecord',
                                   width:448
                                },{
                               	 xtype:'textarea',
                                 fieldLabel:'实施备注',
                                 name:'constructionProject.implementRecord',
                                 width:448
                            }]
                           }]
                       },{
                           layout:'column',
                           bodyStyle:"padding:5px;",
                           border:false,
                           items:[{
                               layout:'form',
                               xtype:'fieldset',
                               title:'检查',  
                               collapsible:true,
                               //默认收起为true，默认为false
                               collapsed : true,
                               bodyStyle:"padding:5px;",
                               columnWidth:1.,
                               items:[{
                               xtype:'datefield',
                               fieldLabel:'检查时间',
                               name:'constructionProject.checkTime',
                               width:146
                               },{
                                   xtype:'textarea',
                                   fieldLabel:'检查人/部门',
                                   name:'constructionProject.checkUnit',
                                   width:448
                                },{
                                	 xtype:'textarea',
                                     fieldLabel:'检查记录',
                                     name:'constructionProject.checkRecord',
                                     width:448
                                },{
                               	 xtype:'textarea',
                                 fieldLabel:'检查备注',
                                 name:'constructionProject.checkRemark',
                                 width:448
                            }]
                           }]
                       },{
                           layout:'column',
                           bodyStyle:"padding:5px;",
                           border:false,
                           items:[{
                               layout:'form',
                               xtype:'fieldset',
                               title:'验收',  
                               collapsible:true,
                               //默认收起为true，默认为false
                               collapsed : true,
                               bodyStyle:"padding:5px;",
                               columnWidth:1.,
                               items:[{
                               xtype:'datefield',
                               fieldLabel:'验收时间',
                               name:'constructionProject.acceptTime',
                               width:146
                               },{
                                   xtype:'textarea',
                                   fieldLabel:'验收人/部门',
                                   name:'constructionProject.acceptUnit',
                                   width:448
                                },{
                                	 xtype:'textarea',
                                     fieldLabel:'验收结论',
                                     name:'constructionProject.acceptConclusion',
                                     width:448
                                },{
                               	 xtype:'textarea',
                                 fieldLabel:'验收备注',
                                 name:'constructionProject.acceptRemark',
                                 width:448
                            }]
                           }]
                       }
               ]
            },
            loadData:{
                getUrl:__ctxPath +"/constructionproject/getConstructionProject.do",
                preName : "constructionProject"
            }
        });
    }
});
